/**
 * GoodsRelation 业务逻辑实现类
 * @author WangXinLei
 * @date 2015-01-14
 */
package com.chnbst.bstyun.service.impl;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.chnbst.bstyun.core.base.BaseService;
import com.chnbst.bstyun.core.common.helper.DaoHelper;
import com.chnbst.bstyun.model.pojo.GoodsRelation;
import com.chnbst.bstyun.service.GoodsRelationService;

@Transactional
@Service
public class GoodsRelationServiceImpl extends BaseService implements GoodsRelationService{

	//命名空间
	private final static String nameSpace = "com.chnbst.bstyun.mapper.GoodsRelationMapper";
		
	@SuppressWarnings("unchecked")
	@Transactional(propagation=Propagation.REQUIRED,readOnly=true)
	@Override
	public List<GoodsRelation> selectByGoodsId(String goodsId) {
		return (List<GoodsRelation>) DaoHelper.list(nameSpace, "selectByGoodsId", goodsId);
	}

	@Transactional(propagation=Propagation.REQUIRED,readOnly=false)
	@Override
	public boolean insertGoodsRelation(GoodsRelation goodsRelation) {
		return DaoHelper.insert(nameSpace, "insertGoodsRelation", goodsRelation);
	}

	@Transactional(propagation=Propagation.REQUIRED,readOnly=false)
	@Override
	public boolean deleteGoodsRelation(String goodsId) {
		return DaoHelper.delete(nameSpace, "deleteGoodsRelation", goodsId);
	}

}
